// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.iso.areas.isoregion.data;

import java.util.ArrayDeque;
import zombie.iso.areas.isoregion.IsoRegions;

public final class DataSquarePos {
    public static boolean DEBUG_POOL = true;
    private static final ArrayDeque<DataSquarePos> pool = new ArrayDeque();
    public int x;
    public int y;
    public int z;

    static DataSquarePos alloc(int int0, int int1, int int2) {
        DataSquarePos dataSquarePos = !pool.isEmpty() ? (DataSquarePos)pool.pop() : new DataSquarePos();
        dataSquarePos.set(int0, int1, int2);
        return dataSquarePos;
    }

    static void release(DataSquarePos dataSquarePos) {
        assert !pool.contains(dataSquarePos);

        if (DEBUG_POOL && pool.contains(dataSquarePos)) {
            IsoRegions.warn("DataSquarePos.release Trying to release a DataSquarePos twice.");
        } else {
            pool.push(dataSquarePos.reset());
        }
    }

    private DataSquarePos() {
    }

    private DataSquarePos reset() {
        return this;
    }

    public void set(int _x, int _y, int _z) {
        this.x = _x;
        this.y = _y;
        this.z = _z;
    }
}
